<?php
$iMaMH = $_GET['maMH'];
$sTenMH= $_GET['tenMH'];
$iGiaMH = $_GET['gia'];


	$flag = false;
	foreach ($_SESSION['cart'] as $key => $value){
		if ($key == $iMaMH)
		  $flag = true;	
	}
	     if ($flag == true) {
	     	$_SESSION['cart'][$iMaMH]['soluong']++;
	     }	 else {
	     	$_SESSION['cart'][$iMaMH]['soluong'] = 1;
	     	$_SESSION['cart'][$iMaMH]['tenMH'] = '$sTenMH';
	     	$_SESSION['cart'][$iMaMH]['gia'] = '$iGiaMH';
	     }



ob_end_clean();
header("location:$_SERVER[HTTP_REFERER]");
